<template>
    <div class="wrap">
        <div v-for="item in list" :key="item.id">
            <FenLei :list="item"></FenLei>
        </div>
        <!-- 返回顶部 -->
        <BackTop :height="100">
            <div id="backTop">
                <i class="iconfont icon-shang goback_icon"></i>
            </div>
        </BackTop>
    </div>
</template>
<script>
import FenLei from "@/components/FenLei";
export default {
    components: {
        FenLei,
    },
    data() {
        return {
            list: [],
            page: 1,
        };
    },
    created() {
        // console.log(this.$route.params);
        // this.myList = this.list;
        this.getData();
    },
    methods: {
        async getData() {
            let res = await this.$fetch(
                `/solutionSubject/themeDetail.do?_dataType=json&_dataClientType=3&_dataClientType=3&client_type=40
                    &themeId=${this.$route.params.themeId}
                    &templatePageSize=6&pageNum=${this.page}`
            );
            //   console.log(res);
            this.list = this.list.concat(res.body.data.theme.themeExtends);
            //   console.log(this.list);
        },
        async more(a) {
            this.page++;
            let res2 = await this.$fetch(
                `/solutionSubject/themeExtend/template.do?_dataType=json&_dataClientType=3&_dataClientType=3&client_type=40
                    &themeExtendId=${a} 
                    &pageSize=6&pageNum=${this.page}`
            ).then((r) => r.json());
            // console.log(res2);
            // console.log(a);
            this.list = this.list.concat(res2.body.data.templates);
        },
    },
};
</script>
<style lang="scss" scoped>
.wrap {
    box-sizing: border-box;
    padding: 0 0.05rem;
    .item {
        text-align: center;
        h1 {
            font-weight: normal;
            line-height: 1.5rem;
        }
    }
    img {
        margin: 0.05rem 0.1rem;
    }
}
</style>